<?php
namespace Modules\Cms;
require_once dirname(__FILE__) .'/../common.php';

class Cmsclass
{
    const TABLE = 't_cms_class';

    public static function fetchList($space)
    {
        $where = '';
        $sql = 'SELECT * FROM '. self::TABLE .' WHERE space="'. $space .'" AND status=1'. $where .' ORDER BY sort DESC';
        $data = getDb()->fetchAll($sql);
        $result = array();
        foreach ($data as $row) {
            $result[$row['idx']] = $row;
        }
        return $result;
    }
    
}
